package com.example.shop_2211.adapter

import android.widget.CheckBox
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.base.entity.CarInfo
import com.example.shop_2211.R
import com.example.shop_2211.utils.GlideUtils

class CarAdapter:BaseQuickAdapter<CarInfo,BaseViewHolder>(R.layout.item_car) {
    override fun convert(holder: BaseViewHolder, item: CarInfo) {
        holder.getView<CheckBox>(R.id.car_cb).isChecked = item.isChecked//复选框状态
        GlideUtils.loadImage(context,item.image,holder.getView(R.id.car_image))
        holder.setText(R.id.car_name,item.storeName)
        holder.setText(R.id.car_price,"￥${item.price}")
        holder.setText(R.id.car_num,item.cartNum.toString())
    }
}